home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / pipeline / abacus / p_line / Index03 / ReadMe < prev   
Encoding:
Text File  |  1994-10-10  |  5.2 KB  |  136 lines

  1. %OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938 
  2. %OP%DP0
  3. %OP%IRY
  4. %OP%PL0
  5. %OP%HM0
  6. %OP%FM0
  7. %OP%BM0
  8. %OP%LM4
  9. %OP%PT1
  10. %OP%PDPipeLine
  11. %OP%WC2,1286,176,1748,0,0,0,0
  12. %CO:A,72,72%
  13. %C%Using the Index and Set_value Functions
  14. %C%by Gerald L Fitton
  15. Keywords:
  16. Index Set_value Push Fitton
  17.  
  18.  
  19. Introduction
  20.  
  21. I have been asked to write an article giving explanations of more of 
  22. the "Index functions".  This is the second of what I expect to be a 
  23. short series of articles in which I shall describe how the "Index 
  24. functions" and "Array functions" may be used.  In the first article, in 
  25. the directory [Index02] (on an earlier disc), I explained how to 'pull' 
  26. a single value from an array.  In this article I explain how, together 
  27. with set_value(,) you can 'push' a value into a single slot within an 
  28. array.
  29.  
  30. What you might not know is that you can vary the receiving slot (into 
  31. which you 'push' a value), specifying the slot with two numbers which 
  32. may themselves be the result of a calculation!  This process is similar 
  33. to 'indirect addressing' - for those of you who know what that means.
  34.  
  35.  
  36. set_value(index(array,col,row),value)
  37.  
  38. First a quick reminder.  In PipeDream 4 the index(array,col,row) 
  39. function works differently from PipeDream 3.
  40.  
  41. The way in which most people use the 'basic' index function is to use 
  42. it to 'pull' a single value from an array.  This was demonstrated in 
  43. the article in Array02 - I suggest that you read that before this one.
  44.  
  45. In this article I shall demonstrate how to 'push' a value into an 
  46. array.  Load the file [Index] from this directory and have a look at 
  47. the formula in slot [Index]B33.  It is the only slot in that 
  48. spreadsheet which contains a formula rather than a value; this formula 
  49. is used to 'push' the value "The_Value" into the slot identified by 
  50. index(Array,Col_No,Row_No).
  51.  
  52. The formula reads:   set_value(index(Array,Col_No,Row_No),The_Value)
  53.  
  54. The words "Array", "Col_No", "Row_No" and "The_Value" in this formula 
  55. are all PipeDream Names.  Place the pointer on the italic f of [Index] 
  56. (just to the right of the PipeDream 4 logo near the top of the [Index] 
  57. file) and click the mouse select (left) button once.  At the bottom of 
  58. the pop-up menu you'll find Edit name.  Run the pointer through Edit 
  59. name and then through Array.  You'll see that Array has been defined as 
  60. the block [Index]C4H9.  To make identification easier I have used a 
  61. consistent pattern for the data held in this array generated by the 
  62. formula 1000*column plus the row - for example the value 4008 appears 
  63. in the fourth column, D, and the eighth row of the [Index] file.
  64.  
  65.  
  66. Other Names
  67.  
  68. You will find that the contents of slots B16, B17 and B18 are named.
  69.  
  70. You can enter values into B16 and B17 (or, like one of our 
  71. correspondents, you can enter a formula which returns a number).  I 
  72. have entered 1 into B16 and 2 into B17.  I have given these slots 
  73. PipeDream Names.  The method of naming a slot is to click on the italic 
  74. f and run the pointer through Define name in the pop-up menu.  Enter 
  75. the Name in the top dialogue box alongside "Name:" and enter the slot 
  76. to which it refers (in our case B16 or B17) in the dialogue box 
  77. alongside "Refers to:".  Have a look at the Edit name dialogue if you 
  78. have doubts.
  79.  
  80. The PipeDream Names I have used are Row_no and Col_No.
  81.  
  82. In the same way I have named the contents of slot B18 as The_Value.
  83.  
  84.  
  85. Using the 'Push' facility
  86.  
  87. Change the value in slot B18 and you will see the new value appear in 
  88. the first column, second row of the array.  When Col_No = 1 and 
  89. Row_No = 2 the number in B18 (The Value) will be pushed into slot C5.
  90.  
  91. If you change the contents of either B16 or B17 then The Value will be 
  92. 'Pushed' into a different part of the Array.
  93.  
  94. The values in B16 and B17 can be calculated values or they themselves 
  95. can be the result of a 'Push' operation, maybe from another document!
  96.  
  97.  
  98. The 'Input Document'
  99.  
  100. Double click on the file [InputDoc] to load it.
  101.  
  102. Change the values in slots [InputDoc]B10B12.
  103.  
  104. You will find that the appropriate value in [Index03]Array changes.
  105.  
  106. These changes are 'pushed' into [Index03] through the formula in 
  107. [InputDoc]C15.  This formula is the only formula in [InputDoc] and it 
  108. uses the Name "In" which is defined in [InputDoc].
  109.  
  110.  
  111. The 'Output Document'
  112.  
  113. Double click on the file [Output] to load it.
  114.  
  115. You will see that the Array (from [Index]) appears in the block A4F9.
  116.  
  117. If you change the [InputDoc] then the [Output] will change!
  118.  
  119. These changes are 'pulled' into [Output] by the formula in [Output]A4.  
  120. This formula uses the Name "Out" which is defined in [Output].
  121.  
  122.  
  123. For Later
  124.  
  125. I have been asked to describe how array operations such as addition and 
  126. multiplication can be used to simplify operations on large blocks of 
  127. numbers in a spreadsheet.  This I shall do on later discs.  However, 
  128. if, in the meantime you have an 'array' problem then please don't 
  129. hesitate to write to me.  If you do then it will help me if you will 
  130. send a disc containing a file of suitable data and some notes in a 
  131. [ReadMe] file saying what it is that you want to do.  Sending me files 
  132. on disc you will help me to be sure that I understand exactly what it 
  133. is you are trying to do; furthermore, it will save me the time it takes 
  134. to construct a file of dummy data (which might not be representative of 
  135. your requirements).
  136.